/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.util.convertor;

import info.peigen.hotpot.manage.core.domain.Role;
import info.peigen.hotpot.manage.core.repository.entity.RoleEntity;
import info.peigen.hotpot.manage.core.service.order.RoleCreateOrder;
import info.peigen.hotpot.manage.core.service.order.RoleEditOrder;
import info.peigen.hotpot.manage.core.service.result.info.RoleInfo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <b>(RoleConvertor)</b>
 * "角色" 转换器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-06-28
 */
@SuppressWarnings("unused")
@Mapper(builder = @Builder(disableBuilder = true))
public interface RoleConvertor {
    RoleConvertor INSTANCE = Mappers.getMapper(RoleConvertor.class);

    // ConvertToEntity
    RoleEntity convertToEntity(Role domain);
    List<RoleEntity> convertToEntitiesByDomain(List<Role> domains);

    RoleEntity convertToEntity(RoleInfo roleInfo);
    List<RoleEntity> convertToEntitiesByInfo(List<RoleInfo> roleInfo);

    // ConvertToDomain
    Role convertToDomain(RoleEntity entity);
    List<Role> convertToDomainsByEntity(List<RoleEntity> entities);
    Role convertToDomain(RoleInfo roleInfo);
    List<Role> convertToDomainsByInfo(List<RoleInfo> infos);

    Role convertToDomain(RoleCreateOrder order);
    Role convertToDomain(RoleEditOrder order);

    // ConvertToInfo
    RoleInfo convertToInfo(Role domain);
    List<RoleInfo> convertToInfosByDomain(List<Role> domains);

    RoleInfo convertToInfo(RoleEntity entity);
    List<RoleInfo> convertToInfosByEntity(List<RoleEntity> entities);
}